package com.polaris.live.adapter

import com.bumptech.glide.Glide
import com.polaris.live.R
import com.polaris.live.common.adapter.BaseBindingAdapter
import com.polaris.live.common.adapter.VBViewHolder
import com.polaris.live.databinding.AdapterGiftReceivedBinding
import com.polaris.live.resp.back_resp.GiftReceivedResp
import com.polaris.live.utils.image.ImageUtils

/**
 * 历史礼物列表
 *
 * @author Created by 长空 on 2023/11/1/004 11:02
 */
class GiftReceivedAdapter : BaseBindingAdapter<AdapterGiftReceivedBinding, GiftReceivedResp>() {

    override fun convert(holder: VBViewHolder<AdapterGiftReceivedBinding>, item: GiftReceivedResp) {
        holder.vb.apply {
            Glide.with(context).load(ImageUtils.imgPath(item.pic))
                .placeholder(R.drawable.img_nothing)
                .error(R.drawable.img_nothing).into(ivGift)
            tvNum.text = "x${item.num}"
        }
    }

}